﻿Public Class InventoryItem

#Region "Attributes"
    Private _ID As String
    Private _Description As String
    Private _PurchaseCost As Decimal
    Private _SalePrice As Decimal
    Private _QuantityOnHand As Integer
    Private _ReorderPoint As Integer
    Private _ReorderQuantity As Integer
#End Region

#Region "Properties"
    Property ID As String
        Get
            Return _ID
        End Get
        Set(ByVal value As String)
            _ID = value
        End Set
    End Property
    Property Description As String
        Get
            Return _Description
        End Get
        Set(ByVal value As String)
            _Description = value
        End Set
    End Property
    Property PurchaseCost As Decimal
        Get
            Return _PurchaseCost
        End Get
        Set(ByVal value As Decimal)
            _PurchaseCost = value
        End Set
    End Property
    Property SalePrice As Decimal
        Get
            Return _SalePrice
        End Get
        Set(ByVal value As Decimal)
            _SalePrice = value
        End Set
    End Property
    Property QuantityOnHand As Integer
        Get
            Return _QuantityOnHand
        End Get
        Set(ByVal value As Integer)
            _QuantityOnHand = value
        End Set
    End Property
    Property ReorderPoint As Integer
        Get
            Return _ReorderPoint
        End Get
        Set(ByVal value As Integer)
            _ReorderPoint = value
        End Set
    End Property
    Property ReorderQuantity As Integer
        Get
            Return _ReorderQuantity
        End Get
        Set(ByVal value As Integer)
            _ReorderQuantity = value
        End Set
    End Property
#End Region

#Region "Constructor"
    Public Sub New(ByVal id As String, ByVal description As String, ByVal purchaseCost As Decimal, ByVal salePrice As Decimal, ByVal quantityOnHand As Integer, ByVal reorderPoint As Integer, ByVal reorderQuantity As Integer)
        _ID = id
        _Description = description
        _PurchaseCost = purchaseCost
        _SalePrice = salePrice
        _QuantityOnHand = quantityOnHand
        _ReorderPoint = reorderPoint
        _ReorderQuantity = reorderQuantity
    End Sub

    Public Sub New(ByRef inventory As InventoryItem)
        _ID = inventory.ID
        _Description = inventory.Description
        _PurchaseCost = inventory.PurchaseCost
        _SalePrice = inventory.SalePrice
        _QuantityOnHand = inventory.QuantityOnHand
        _ReorderPoint = inventory.ReorderPoint
        _ReorderQuantity = inventory.ReorderQuantity
    End Sub
#End Region

#Region "Behavioral Methods"
    Public Overrides Function ToString() As String
        Return _toString()
    End Function

    Private Function _toString() As String
        Dim _tmpStr As String

        _tmpStr = "( INVENTORY: " & "ID:" & _ID & ", Description:" & _Description & ", Purchase Cost:" & _PurchaseCost.ToString("N1") & ", Sale Price:" & _SalePrice & ", Quantity:" & _QuantityOnHand & " )"

        Return _tmpStr

    End Function
#End Region
End Class
